export function randomInt(min, max) {
    return Math.floor(Math.random() * (max - min + 1)) + min
}
// const articleLength=randomInt(3000,5000)
// const sectionLength=randomInt(200,500)


export function createRandomPicker(arr) {
    arr = [...arr]
    function randomPick() {
        const len = arr.length - 1
        const index = randomInt(0, len)
        const picked=arr[index];
        [arr[index], arr[len]] = [arr[len], arr[index]]
        return picked;
    }
    randomPick()
    return randomPick
}
